<template>
    <div class="safeCheck">
        <!-- 头部 -->
        <!-- <div class="header">
            <x-icon type="ios-arrow-left"
                    size="40"
                    class="icon-white"
                    @click="$router.push('./Index/newEdit')"></x-icon>安全检查
        </div> -->
        <!-- 内容部分 -->
        <div class="safeCheck_main">
            <div class="mainBox">
                <ul>
                    <li @click="showDiv">
                        <div class="newtitle">
                            <img src="../../../static/images/index/safe1.png"
                                 alt="">
                            <span>新增安全检查</span>
                        </div>
                        <x-icon type="ios-arrow-right"
                                size="20"
                                class="icon-right"></x-icon>
                    </li>
                    <li @click="view2">
                        <div class="newtitle">
                            <img src="../../../static/images/index/safe2.png"
                                 alt="">
                            <span>安全检查台账</span>
                        </div>
                        <x-icon type="ios-arrow-right"
                                size="20"
                                class="icon-right"></x-icon>
                    </li>
                    <li @click="$router.push('./safeView3')">
                        <div class="newtitle">
                            <img src="../../../static/images/index/safe3.png"
                                 alt="">
                            <span>需要执行的检查</span>
                        </div>
                        <x-icon type="ios-arrow-right"
                                size="20"
                                class="icon-right"></x-icon>
                    </li>
                </ul>
                <actionsheet v-model="show"
                             :menus="menu7"
                             @on-click-menu="click">
                </actionsheet>
            </div>
        </div>
        <myMenu @clickBack="back"
                backPath='/Index/newEdit'></myMenu>
    </div>
</template>
<script>
import { Actionsheet } from 'vux'
import myMenu from '@/commonComponents/menu'
export default {
    components: {
        Actionsheet,
        myMenu
    },
    data () {
        return {
            show: false,
            menu7: {},
            parmas: {
                allowPaging: 'true',
                business: 'GetCheckWorkTypeMenu',
                pageIndex: 0,
                pageSize: 20000,
                tokenId: 'A3944C2D655B11D684296E71CB81C9BD',
                userId: '615123137'
            }
        }
    },
    mounted () {
        var token = JSON.parse(window.localStorage.getItem('userInfo'))
        this.parmas.userId = token.userid
        this.listArr()
    },
    methods: {
        back () {

        },
        view2 () {
            window.sessionStorage.removeItem('star')
            window.sessionStorage.removeItem('end')
            window.sessionStorage.removeItem('id1')
            window.sessionStorage.removeItem('ids2')
            window.sessionStorage.removeItem('name1')
            window.sessionStorage.removeItem('name3')
            window.sessionStorage.removeItem('paramsName')
            this.$router.push('./safeView2')
        },
        showDiv () {
            if (this.menu7.length > 0) {
                this.show = true
            }
        },
        click (key, item) {
            this.$store.state.name1 = []
            if (item == '日常检查') {
                // this.$store.state.selectidlist1 = []
                // this.$store.state.selectidlist2 = []
                // this.$store.state.selectidlist3 = []
                // this.$store.state.checkcompany = ''
                // this.$store.state.checktime = ''
                // this.$store.state.HiddenDangers = []
                this.$router.push({ path: '/testing' })
                localStorage.newadd = 'add'
            } else {
                this.$router.push({ path: '/viewAddPlan', query: { title: item } })
                window.sessionStorage.setItem('checkType', item)
                window.sessionStorage.removeItem('checkName')
                window.sessionStorage.removeItem('checkArea')
                window.sessionStorage.removeItem('checkPoint')
                window.sessionStorage.removeItem('checkContent')
                window.sessionStorage.removeItem('teamLeader')
                window.sessionStorage.removeItem('id2')
                window.sessionStorage.removeItem('teamLeaderId')
                window.sessionStorage.removeItem('star')
                window.sessionStorage.removeItem('name2')
                this.$store.state.name1 = []
                this.$store.state.id1 = []
                this.$store.state.demoArr = []
                this.$store.state.ulList = []
            }
        },
        listArr () {
            this.$axiosAjax.getConfigJson(this.parmas).then((res) => {
                if (res.status == 200) {
                    this.menu7 = res.data.data
                }
            }
            )
        }
    }
}
</script>
<style lang="less" scope>
.safeCheck {
    width: 100%;
    height: 100%;
    .safeCheck_main {
        height: 603px;
        width: 100%;
        background-color: #ebeef2;
        padding-top: 10px;
        .mainBox {
            width: 100%;
            height: 593px;
            background-color: #fff;
            border-radius: 10px 10px 0 0;
            ul {
                padding: 20px;
                li {
                    padding: 10px 0 10px 20px;
                    border-bottom: 1px solid #eee;
                    position: relative;
                    display: flex;
                    justify-content: space-between;
                    img {
                        width: 30px;
                        height: 30px;
                    }
                    .vux-x-icon {
                        margin-top: 4px;
                        fill: #999;
                        // float: right;
                    }
                    span {
                        font-size: 14px;
                        margin-left: 6px;
                        // position: absolute;
                        // left: 70px;
                        // top: 30px;
                    }
                    > .newtitle {
                        display: flex;
                        align-items: center;
                    }
                }
            }
        }
    }
    .weui-actionsheet {
        top: 30%;
        // width: 90%;
        // left: 20px;
        background-color: rgba(0, 0, 0, 0);
    }
    .weui-actionsheet__menu {
        margin: 0 auto;
        width: 80%;
        // height: 200px;
        overflow-y: auto;
        line-height: 20px;
        border-radius: 10px;
    }
    .vux-actionsheet-menu-default {
        padding: 20px 20px !important;
        text-align: left;
        font-size: 16px;
    }
}
</style>
